<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/4/28 0028
 * Time: 下午 5:02
 */

namespace app\sports_admin\vaildate;


class Grade extends Base
{
    protected $rule = [
        'id'=>'require|isPositiveInteger',
    ];

    protected $message = [
        'id'=>'编号必须为整数',
    ];
    //添加验证
    public function insert()
    {
        $rule = [
            'grade'=>'require',
            'type'=>'require|integer',
            'grade_name'=>'require'
        ];
        $msg = [
            'grade'=>'请输入年级名称',
            'type'=>'类别必须是整数',
            'grade_name'=>'请输入类别名称'
        ];
        self::goCheck($rule,$msg);
    }
    //修改验证
    public function update()
    {
        $rule = [
            'id'=>'require|integer',
            'grade'=>'require',
            'type'=>'require|integer',
            'grade_name'=>'require'
        ];
        $msg = [
            'id'=>'请选择需要修改的年级',
            'grade'=>'请输入年级名称',
            'type'=>'类别必须是整数',
            'grade_name'=>'请输入类别名称'
        ];
        self::goCheck($rule,$msg);
    }
}